/**
 * Playlist
 */
var playlist = {
	
	id : -1,
	
	load : function(id, callback) {
		debug.print("playlist.load [id: " + id + "]");
		this.id = id;
		this.request(callback);
	},
		
	request : function(callback) {
		debug.print("playlist.request");
		$.getJSON("/playlist/video_list/json?id="+playlist.id, function(data){
			if (ObjectLength(data.videos) == 0) {
				flash.flash("Playlist", "is empty");
			} else {
				np.addMultiple(data.videos);
			}
			if (callback) {
				callback();
			}
		});
	}
	
}
